<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__sysclk__pm__funcs.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Functions<div class="ingroups"><a class="el" href="group__group__sysclk.html">SysClk       (System Clock)</a> &raquo; <a class="el" href="group__group__sysclk__pm.html">Low Power Callback</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga34bd0e837cdf7d0953a7e0f5219905b5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__syspm__data__enumerates.html#ga601b1cb722cb091133caf33d8ab235ca">cy_en_syspm_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sysclk__pm__funcs.html#ga34bd0e837cdf7d0953a7e0f5219905b5">Cy_SysClk_DeepSleepCallback</a> (<a class="el" href="structcy__stc__syspm__callback__params__t.html">cy_stc_syspm_callback_params_t</a> *callbackParams, <a class="el" href="group__group__syspm__data__enumerates.html#gae06cd8869fe61d709ad6145ca9f3cd63">cy_en_syspm_callback_mode_t</a> <a class="el" href="group__group__ipc__bt__data__structures.html#ga37e90f5e3bd99fac2021fb3a326607d4">mode</a>)</td></tr>
<tr class="memdesc:ga34bd0e837cdf7d0953a7e0f5219905b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Callback function to be used when entering system Deep Sleep mode.  <a href="#ga34bd0e837cdf7d0953a7e0f5219905b5">More...</a><br /></td></tr>
<tr class="separator:ga34bd0e837cdf7d0953a7e0f5219905b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga34bd0e837cdf7d0953a7e0f5219905b5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga34bd0e837cdf7d0953a7e0f5219905b5">&#9670;&nbsp;</a></span>Cy_SysClk_DeepSleepCallback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__syspm__data__enumerates.html#ga601b1cb722cb091133caf33d8ab235ca">cy_en_syspm_status_t</a> Cy_SysClk_DeepSleepCallback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__syspm__callback__params__t.html">cy_stc_syspm_callback_params_t</a> *&#160;</td>
          <td class="paramname"><em>callbackParams</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__syspm__data__enumerates.html#gae06cd8869fe61d709ad6145ca9f3cd63">cy_en_syspm_callback_mode_t</a>&#160;</td>
          <td class="paramname"><em>mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Callback function to be used when entering system Deep Sleep mode. </p>
<p>This function is applicable if:</p><ul>
<li>The FLL is enabled</li>
<li>The PLL is enabled and is driven by ECO</li>
</ul>
<p>This function performs the following:</p>
<ol type="1">
<li>Before entering Deep Sleep, the clock configuration is saved in SRAM. If the FLL/PLL source is the ECO, then the FLL/PLL is bypassed and the source is changed to IMO. <br />
 If the FLL is enabled - it is just bypassed.</li>
<li>Upon wakeup from Deep Sleep, the function waits for ECO stabilization, then restores the configuration and waits for the FLL/PLL to regain their frequency locks. <br />
 If ECO is not used and FLL is enabled - it waits for FLL lock and unbypasses it.</li>
</ol>
<p>The function prevents entry into Deep Sleep mode if the measurement counters are currently counting; see <a class="el" href="group__group__sysclk__calclk__funcs.html#ga0a87e123411d5711344780ddfa492f37">Cy_SysClk_StartClkMeasurementCounters</a>.</p>
<p>This function can be called during execution of <a class="el" href="group__group__syspm__functions__power.html#ga5150c28fe4d2626720c1fbf74b3111ca">Cy_SysPm_CpuEnterDeepSleep</a>. To do so, register this function as a callback before calling <a class="el" href="group__group__syspm__functions__power.html#ga5150c28fe4d2626720c1fbf74b3111ca">Cy_SysPm_CpuEnterDeepSleep</a> - specify <a class="el" href="group__group__syspm__data__enumerates.html#gga8c2960c0164ead1cfa86e7d6846b6ff0abc51d74deff0ceea4304b01b2d57bd9d">CY_SYSPM_DEEPSLEEP</a> as the callback type and call <a class="el" href="group__group__syspm__functions__callback.html#ga0d58b00c8dc764a6371590f70e2f73c7">Cy_SysPm_RegisterCallback</a>.</p>
<dl class="section note"><dt>Note</dt><dd>This function is recommended to be the last callback that is registered. Doing so minimizes the time spent on low power mode entry and exit. <br />
This function implements all four SysPm callback modes <a class="el" href="group__group__syspm__data__enumerates.html#gae06cd8869fe61d709ad6145ca9f3cd63">cy_en_syspm_callback_mode_t</a>. So the <a class="el" href="structcy__stc__syspm__callback__t.html#a1b49c2454ac29e52261e28eb9071413b">cy_stc_syspm_callback_t::skipMode</a> must be set to 0UL. <br />
This function does not support such cases as, for example, FLL is enabled but bypassed by user code before entering Deep Sleep. <br />
You can use this callback implementation as an example to design custom low-power callbacks for certain user application.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">callbackParams</td><td>structure with the syspm callback parameters, see <a class="el" href="structcy__stc__syspm__callback__params__t.html">cy_stc_syspm_callback_params_t</a>.</td></tr>
    <tr><td class="paramname">mode</td><td>Callback mode, see <a class="el" href="group__group__syspm__data__enumerates.html#gae06cd8869fe61d709ad6145ca9f3cd63">cy_en_syspm_callback_mode_t</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Error / status code; see <a class="el" href="group__group__syspm__data__enumerates.html#ga601b1cb722cb091133caf33d8ab235ca">cy_en_syspm_status_t</a>. Pass if not doing a clock measurement, otherwise Fail. Timeout if timeout waiting for ECO, FLL or PLL to get stable / regain its frequency lock. CY_PRA_STATUS_* - For the PSoC 64 devices there are possible situations when function returns the PRA error status code <a class="el" href="group__group__pra__enums.html#ga60be13e12e82986f8c0d6c6a6d4f12c5">cy_en_pra_status_t</a> instead of <a class="el" href="group__group__sysclk__returns.html#gad6699a184e2e3c01433251b0981558f3">cy_en_sysclk_status_t</a>. This is because for PSoC 64 devices the function uses the PRA driver to change the protected registers. Refer to <a class="el" href="group__group__pra__enums.html#ga60be13e12e82986f8c0d6c6a6d4f12c5">cy_en_pra_status_t</a> for more details.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: The application uses FLL/PLL sourced from the ECO. The device</span></div><div class="line"><span class="comment">                 needs to enter chip Deep Sleep. The ECO and FLL/PLL must be</span></div><div class="line"><span class="comment">                 suitably prepared before entering low power mode. */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Register all the Deep Sleep callbacks for other peripherals.</span></div><div class="line"><span class="comment">       The SysClk callback is recommended to be registered last to minimize</span></div><div class="line"><span class="comment">       the low power mode entry and wakeup timings. */</span></div><div class="line"></div><div class="line">    <a class="code" href="structcy__stc__syspm__callback__params__t.html">cy_stc_syspm_callback_params_t</a> clkCallbackParams = {</div><div class="line">        <span class="comment">/*.base       =*/</span> NULL,</div><div class="line">        <span class="comment">/*.context    =*/</span> NULL</div><div class="line">    };</div><div class="line"></div><div class="line">    <a class="code" href="structcy__stc__syspm__callback__t.html">cy_stc_syspm_callback_t</a> clkCallback = {</div><div class="line">        <span class="comment">/*.callback       =*/</span> &amp;<a class="code" href="group__group__sysclk__pm__funcs.html#ga34bd0e837cdf7d0953a7e0f5219905b5">Cy_SysClk_DeepSleepCallback</a>,</div><div class="line">        <span class="comment">/*.type           =*/</span> <a class="code" href="group__group__syspm__data__enumerates.html#gga8c2960c0164ead1cfa86e7d6846b6ff0abc51d74deff0ceea4304b01b2d57bd9d">CY_SYSPM_DEEPSLEEP</a>,</div><div class="line">        <span class="comment">/*.skipMode       =*/</span> 0UL,</div><div class="line">        <span class="comment">/*.callbackParams =*/</span> &amp;clkCallbackParams,</div><div class="line">        <span class="comment">/*.prevItm        =*/</span> NULL,</div><div class="line">        <span class="comment">/*.nextItm        =*/</span> NULL,</div><div class="line">        <span class="comment">/*.order          =*/</span> 0</div><div class="line">    };</div><div class="line"></div><div class="line">    <span class="comment">/* Register the clock callback */</span></div><div class="line">    <span class="keywordflow">if</span>(!<a class="code" href="group__group__syspm__functions__callback.html#ga0d58b00c8dc764a6371590f70e2f73c7">Cy_SysPm_RegisterCallback</a>(&amp;clkCallback))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Could not register callback. Examine the number of registered callbacks */</span></div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">/* Ensure that the clock measurement is not running and enter chip Deep Sleep */</span></div></div><!-- fragment --></dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
